﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FederationMembershipDB
{
    class Purch_MembershipRegistration
    {
        private double _AmntPaid = 0;
        private DateTime _DtePaid;
        private bool _QuestCompleted;
        private bool _ContractCompleted;
        private DateTime _ExpiryDate;
        private int _MembershipNumber;
        private string _MemberhipType; //e.g. Senior/Junior/Mighty Mites

        public double AmountPaid
        {
            get { return _AmntPaid; }
            set { _AmntPaid = value; }
        }

        public DateTime DatePaid
        {
            get { return (DateTime)_DtePaid; }
            set 
            {
                DateTime dte;
                try
                {
                    dte = value;
                    _DtePaid = value;
                    ExpiryDate = _DtePaid.AddYears(1);
                }
                catch (Exception ex)
                {
                    //TODO: test exception
                    SystemException sysExc = new SystemException(ex.Message);
                    throw sysExc;
                }                 
            }
        }

        public bool QuestionannaireCompleted
        {
            get { return _QuestCompleted; }
            set { _QuestCompleted = (bool)value; }
        }

        public bool ContractCompleted
        {
            get { return _ContractCompleted; }
            set { _ContractCompleted = (bool)value; }
        }

        public DateTime ExpiryDate
        {
            get { return (DateTime)_ExpiryDate; }
            set
            {
                DateTime dte;
                try
                {
                    dte = value;
                    _ExpiryDate = value;
                }
                catch (Exception ex)
                {
                    SystemException sysExc = new SystemException(ex.Message);
                    throw sysExc;
                }
            }
        }

        public int MembershipNumber
        {
            get { return _MembershipNumber; }
            set { _MembershipNumber = value; }
        }

        public string MembershipType
        {
            get { return _MemberhipType; }
            set { _MemberhipType = value; }
        }
    }
}
